package com.example.libo.huihui.utils;

import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;

/**
 * Created by libo on 2017/1/15.
 */

public class AnimUtils {

    /**
     * 消失动画
     * @param view
     */
    public static void appearAnim(final View view){
        AlphaAnimation appearAnimation = new AlphaAnimation(1, 0);
        appearAnimation.setDuration(5000);
        appearAnimation.setAnimationListener(new Animation.AnimationListener() {
            @Override
            public void onAnimationStart(Animation animation) {

            }

            @Override
            public void onAnimationEnd(Animation animation) {
                view.setVisibility(View.GONE);
            }

            @Override
            public void onAnimationRepeat(Animation animation) {

            }
        });
        view.setAnimation(appearAnimation);
    }
}
